import React from 'react'
import ReactDOM from 'react-dom/client'

function App() {
  const [count, setCount] = React.useState(0)
  const [count1, setCount1] = React.useState(10)

  const addHandle = () => setCount(count + 1)
  const addHandle1 = () => setCount1(count1 + 1)

  return (
    <div>
      <h1>计数1：{count}</h1>
      <button onClick={addHandle}>添加1</button>
      <hr />
      <h1>计数1：{count1}</h1>
      <button onClick={addHandle1}>添加2</button>
    </div>
  )
}

const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(<App />)
